//
//  PLEndpoint.h
//  Plankton    
//
//  Created by Marc Schlichte on 2008-05-03.
//  Copyright 2008 Framework Labs. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol PLEndpointDelegate;

@interface PLEndpoint : NSObject 
{
    CFSocketRef             sock;
    unsigned short          port;
    id<PLEndpointDelegate>  delegate;
}

@property(assign)   id<PLEndpointDelegate>  delegate;
@property(readonly) NSString                *hostname;
@property(readonly) unsigned short          port;

- (void)sendData:(NSData *)data toHost:(NSString *)host port:(unsigned short)port;

@end

@protocol PLEndpointDelegate <NSObject>
@optional
- (void)endpoint:(PLEndpoint *)endpoint didReceiveData:(NSData *)data from:(NSData *)addr;
- (void)endpoint:(PLEndpoint *)endpoint encounteredProblem:(NSString *)problem;

@end

